﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true"
    CodeBehind="Product_List.aspx.cs" Inherits="TimKen.Web.Admin.Product.Product_List" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentTitle" runat="server">
    <%=GetLangString("MenuProductList")%>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentMain" runat="server">
    <!-- 产品搜索 -->
    <div class="form-div">
        <img src="../images/icon_search.gif" width="26" height="22" border="0" alt="SEARCH" />
        <!-- 分类 -->
        <asp:DropDownList ID="ddlCategory" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlCategory_SelectedIndexChanged">
        </asp:DropDownList>
        <!-- 品牌 -->
        <asp:DropDownList ID="ddlBrand" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlBrand_SelectedIndexChanged">
        </asp:DropDownList>
        <asp:CheckBox ID="chkShowFreeze" runat="server" AutoPostBack="True" OnCheckedChanged="chkShowFreeze_CheckedChanged" />
        <br />
        <!-- 关键字 -->
        <%=GetLangString("KeyWord")%>：<asp:TextBox ID="txtKeywords" runat="server"></asp:TextBox>
        <asp:Button ID="btnSearch" runat="server" CssClass="button" OnClick="btnSearch_Click" />
    </div>
    <div class="list-div">
        <!-- 产品列表 -->
        <asp:GridView ID="grdProduct" runat="server" AutoGenerateColumns="False" DataKeyNames="ProductID"
            PageSize="15" AllowSorting="True" CssClass="grid" OnSorted="grdProduct_Sorted">
            <Columns>
                <asp:TemplateField>
                    <HeaderTemplate>
                        <%=GetLangString("ItemCode")%>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <%#Eval("ItemCode")%>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField>
                    <ItemStyle Width="150" />
                    <HeaderTemplate>
                        <%=GetLangString("ProductName")%>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <%#Eval("Name")%>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField>
                    <ItemStyle Width="150" />
                    <HeaderTemplate>
                        <%=GetLangString("BrandName")%>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <%#Eval("BrandName")%>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField>
                    <ItemStyle Width="160" />
                    <HeaderTemplate>
                        <%=GetLangString("DateAdded")%>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <%#Eval("DateAdded","{0:d}")%>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField>
                    <ItemStyle Width="160" />
                    <HeaderTemplate>
                        <%=GetLangString("BasicPrice")%>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <%#GetProductBasePrice(int.Parse(Eval("ProductID").ToString()))%>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField>
                    <ItemStyle Width="160" />
                    <HeaderTemplate>
                        <%=GetLangString("Freeze")%>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <%#GetBoolPic(TimKen.App.Tools.CheckFrozen( Boolean.Parse(Eval("Freeze").ToString()),Eval("FreezeFrom"),Eval("FreezeTo")))%>
                    </ItemTemplate>
                </asp:TemplateField>
                
                
                   <asp:TemplateField>
                    <ItemStyle Width="160" />
                    <HeaderTemplate>
                        <%=GetLangString("IsDisplay")%>
                    </HeaderTemplate>
                    <ItemTemplate>
               <img src='<%#Boolean.Parse(Eval("IsDisplay").ToString()) == true ? "../../Admin/Images/yes.gif" : "../../Admin/Images/no.gif"%>'   />
                    </ItemTemplate>
                </asp:TemplateField>
                
                 <asp:TemplateField>
                    <ItemStyle Width="160" />
                    <HeaderTemplate>
                        <%=GetLangString("Recommend")%>
                    </HeaderTemplate>
                    <ItemTemplate>
               <img src='<%#Boolean.Parse(Eval("IsRecommend").ToString()) == true ? "../../Admin/Images/yes.gif" : "../../Admin/Images/no.gif"%>'   />
                    </ItemTemplate>
                </asp:TemplateField>
                
                
                <asp:TemplateField>
                    <ItemStyle Width="80" HorizontalAlign="Center" />
                    <HeaderTemplate>
                        <%=GetLangString("Operation")%>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <a href='Product_Info.aspx?Act=Edit&ProductID=<%#DataBinder.Eval(Container.DataItem, "ProductID")%>'>
                            <img src="../images/icon_edit.gif" alt='<%#GetLangString("Edit")%>' /></a>
                            
                            
                               <a href='Comment_Manage.aspx?ProductID=<%#DataBinder.Eval(Container.DataItem, "ProductID")%>'>
                            <img src="../images/icon_view.gif" /></a>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <HeaderStyle HorizontalAlign="Center" />
        </asp:GridView>
        <div class="pager-div">
            <ux:AspNetPager ID="AspNetPager1" runat="server" Width="100%" ShowPageIndexBox="Always" 
                HorizontalAlign="right" EnableTheming="true" AlwaysShow="true"  PageIndexBoxType="TextBox"
                OnPageChanged="AspNetPager1_PageChanged" ImagePath="/images/" NavigationButtonType="Image"
                ButtonImageNameExtension="n" CpiButtonImageNameExtension="r" PagingButtonType="Image">
            </ux:AspNetPager>
        </div>
    </div>
    
    
       <div class="list-div" style="margin-bottom: 5px">
        <table cellpadding="3" cellspacing="1">
            <tr>
                <th colspan="6">
                    <%=GetLangString("Operation") %>
                </th>
            </tr>
            <tr>
                <td><%=GetLangString("AtttributeCategory")%>
                    <asp:Button ID="btnDownLoadTemplate" runat="server" OnClick="btnDownLoadTemplate_Click" CssClass="button" /> 
                   <asp:FileUpload ID="FileUpload1" runat="server" />
                    <asp:Button ID="btnUploadProduct" runat="server"  OnClick="btnUploadProduct_Click"
                        CssClass="button" />
                </td>
            </tr>
            
            
             <tr>
                <td><%=GetLangString("DisplayInfo")%>
                    <asp:Button ID="btnDownLoadTemplate2" runat="server" OnClick="btnDownLoadTemplate2_Click" CssClass="button" /> 
                   <asp:FileUpload ID="FileUpload2" runat="server" />
                    <asp:Button ID="btnUploadProduct2" runat="server"  OnClick="btnUploadProduct2_Click"
                        CssClass="button" />
                </td>
            </tr>
            
        </table>
    </div>
    
</asp:Content>
